<template>
  <ul class="wrap items">
    <li v-for="item in data" :key="item.id">
      <div class="img-box">
        <img :src="'http://sc.wolfcode.cn' + item.coverImg" alt="" />
      </div>
      <div class="txt">
        <h2>{{ item.title }}</h2>
        <p>
          {{ item.coin }}
          <img src="../assets/img/monad.png" alt="" />
        </p>
        <span>立即兑换</span>
      </div>
      <img
        src="../assets/img/section_hot.png"
        v-show="item.isHotSale"
        alt=""
        class="label"
      />
      <img
        src="../assets/img/section_new.png"
        v-show="item.isLatest"
        alt=""
        class="label"
      />
    </li>
  </ul>
</template>

<script>
export default {
  data() {
    return {};
  },
  props: ["data"],

  mounted() {},

  methods: {},
};
</script>

<style lang="less" scoped>
.items {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  li {
    position: relative;
    width: 285px;
    height: 412px;
    transition: 1s;
    padding-top: 30px;
    cursor: pointer;
    .label {
      position: absolute;
      top: 30px;
      left: 0;
    }
    .img-box {
      width: 285px;
      height: 250px;
      img {
        width: 285px;
        height: 250px;
      }
    }
    .txt {
      width: 285px;
      height: 162px;
      background: #ffffff;
      font-size: 18px;
      font-family: SourceHanSansSC;
      display: flex;
      flex-wrap: wrap;
      justify-content: space-around;
      text-align: center;
      h2 {
        height: 30px;
        line-height: 30px;
        width: 100%;
        font-weight: 300;
        color: #333333;
        line-height: 23px;
        padding: 20px;
        box-sizing: border-box;
      }
      p {
        width: 100%;
        height: 18px;
        line-height: 18px;
        font-weight: bold;
        color: #fd604d;
        line-height: 23px;
        img {
          width: 20px;
          vertical-align: middle;
        }
      }
      span {
        width: 100px;
        height: 36px;
        border: 1px solid #0a328e;
        line-height: 36px;
        color: #0a328e;
      }
    }
  }
}

.items li:hover {
  .txt span {
    background-color: #0a328e;
    color: #ffffff;
  }
  transform: translateY(-20px);
  box-shadow: 0 5px 10px 1px rgb(229, 226, 226);
}
/* .fade-enter,
.fade-leave-to {
  transform: translateY(0);
}
.fade-enter-active,
.fade-leave-active {
  transition: translateY(-20px) 1s;
} */
</style>